    ### DATAPACK CREATED BY: ...standing on the shoulders of giants...###

...no really...

##################
# INFERNALDEVICE #
##################
Seriously, this pack wouldn't have been possible without their extensive informative support. Their youtube videos and accompanying datapacks have made projects like this possible. Without them, it would still be stuck in one of the many "Ask 4 Help" forums. Please, check out InfernalDevice's work at their youtube channel: https://www.youtube.com/@InfernalDevice I'm more than willing to wager, you'll learn something not just new, but useful to your datapack ambitions!

#############
# GALSERGEY #
#############
The other giant, whose brain has been picked through the years of reddit posts/comments/responses is GalSergy. You can find their irreplaceable information on reddit: https://www.reddit.com/user/GalSergey/

###############################
# Various Communities & Tools #
###############################
In no particular order: https://mcstacker.net/  https://www.reddit.com/r/MinecraftCommands/  https://misode.github.io/  Cloud Wolf MC's discord community:https://discord.gg/VbsGPB3xmz  https://datapack.wiki/  https://minecraft.wiki/  https://www.plotz.co.uk/ (Amaing that site is still goin' strong!)

A *massive*...

 /$$$$$$$$ /$$   /$$  /$$$$$$  /$$   /$$ /$$   /$$       /$$     /$$ /$$$$$$  /$$   /$$
|__  $$__/| $$  | $$ /$$__  $$| $$$ | $$| $$  /$$/      |  $$   /$$//$$__  $$| $$  | $$
   | $$   | $$  | $$| $$  \ $$| $$$$| $$| $$ /$$/        \  $$ /$$/| $$  \ $$| $$  | $$
   | $$   | $$$$$$$$| $$$$$$$$| $$ $$ $$| $$$$$/          \  $$$$/ | $$  | $$| $$  | $$
   | $$   | $$__  $$| $$__  $$| $$  $$$$| $$  $$           \  $$/  | $$  | $$| $$  | $$
   | $$   | $$  | $$| $$  | $$| $$\  $$$| $$\  $$           | $$   | $$  | $$| $$  | $$
   | $$   | $$  | $$| $$  | $$| $$ \  $$| $$ \  $$          | $$   |  $$$$$$/|  $$$$$$/
   |__/   |__/  |__/|__/  |__/|__/  \__/|__/  \__/          |__/    \______/  \______/ 

...to all of those mentioned! (Font made using https://patorjk.com/software/taag/)

#########################################################################################################################

    ##############################
    ## HOW TO USE THIS DATAPACK ##
    ##############################
## Data Driven Trades:##
- These changes require no special action from users to experience! Trades, offered by Villagers in the unmodified gameplay experience, have been reworked to: standardize material costs/trade limits/exchange quantities, remove random trade selections/enchantments/dyes, add omitted trades, etc. Full details on all changes from the unmodifed trades are documented in the file `Default Trade Change Log`.

## Organized Master Villager trades: ##
- Simply interacting with master level Villagers, in any profession, will rearrange all offered trades so they appear in a more uniform and useful order. Generally, all 'purchase <asset> for Emerald' trades are offered first, 'equipment' seconds, 'items' third, and 'blocks' last. Colored/Stained trades are listed in repeating rainbow order. Full details on all changes from the initial random selection are documented in the file 'Organized Master Villager Trades Order'.

## Suspicious Stews Made Memorable ##
- These changes require no special action from users to experience! All Suspicious stews found in the world, crafted by the user, or purchased from a Famer Villager have had their durations increased for a memorable experience; Resulting effects restore more, harm more, and impede for longer. 

!⯀!NOTE:Eventual death is possible (Wither).!⯀!NOTE:

!⯀!NOTE: As of version 26.1, it's not possible to alter the resulting effect durations from Suspicious Stews acquired from milking a Brown Mooshroom. These stews offer the default duration of effects upon consumption.!⯀!

###########################################################################################################################################

    ############################
    ## HOW THIS DATAPCK WORKS ##
    ############################
This datapack is made up of 3 main systems:
- Data Driven Trades
- Organized Master Villager Trades
- Suspicious Stews Made Memorable

###########################################################################################################################################

    ##########################
    ### DATA DRIVEN TRADES ###
    ##########################
This feature, simply removes all random trade offerings from each profesison at each level. If the profession only offered 1 of 16 options, all 16 are always offered.
    #############################
    # How this is accomplished: #
Three files, in three distinct locations are required. (Please, read slowly as there a duplicate names, but none are the same...thanks Mojang :/)
- data / minecraft / trade_set / <profession> / level_<#>.json
- data / minecraft / tags / villager_trade / <profession> / level_<#>.json
- data / minecraft / villager_trade / <profession> / <#> / <trade file name>.json

#####################################################################
# 'level_<#>.json' from 'data / minecraft / trade_set/<profession>/'#
This is the 1st in the series to be called upon. It specifics the 'amount' of trades that will be offered at the specified level of the profession (1=Novice / 2=Amateur / 3=Journeyman / 4=Expert / 5=Master). As well, what 'trades' will be offered (found in a different file). There's also the 'random_sequence' which...seems silly to this author as I haven't figured out how to make it do anything other than...randomize the given trades.

!⯀!NOTE: "#minecraft:<profession> / level_<#>.json" actually specifies the file located at 'data / minecraft / tags / villager_trade /'!⯀!

####################################################################################
# 'level_<#>.json' from 'data / minecraft / tags / villager_trade / <profession> /'#
This file contains a list of all 'trade files' offered at a given level of the profession, and where they're located. Example: "minecraft:librarian/1/emerald_bookshelf" = the file 'emerald_bookshelf.json' located in 'data / minecraft / villager_trade / 1 /'
!!!NOTE: Addition of the line '"replace": true,' MUST be added to this file when located inside of the 'minecraft' folder. If not, the datapack specified trades, as well as the default trades will appear intermingled.

###########################################################################################
# '<trade file name>.json' from 'data / minecraft / villager_trade / <profession> / <#> /'#
This file contains the actual items, quantities, modifiers, villager experience etc. All the details of a normal villager trade. Use Misode's tool to help understand and generate your own! https://misode.github.io/villager-trade/ 

▲TIP: If you're building your own trades, and an error like this comes up when using '/reload':
'Couldn't load tag minecraft:<profession>/level_<#> as it is missing following references: minecraft:<profession>/<#>/<trade_file_name.json>  (from file/<datapack_name>)'
If the files are where they're supposed to be, close out of the world, and re-enter. If they're where they're supposed to be and the world won't load back in, this means there's an error in the file/folder name.▲

!⯀!NOTE: Custom files/folders can be used, but require a different folder structure, and don't require the `"replace": true,` addition. The provided noted above are for files ONLY located within the 'minecraft' folder!⯀!

    ********************************
    *Want to learn more of the why?*
Introduced in version 26.1 Snapshot 1,'Data Driven Trades' enabled the modifications of the default trades offered by all professions at each level. Prior to this ability, the inability to modify the default trades has been the single missing linchpin preventing this system from becoming a reality. In the default game, Librarians offer 1 of 113 possible enchantment trades (1 for each possible level). On average, a player will have to place/break/replace/check the trades of a Librarian over 2,000 times to obtain a trade for each enchantment at the maximum level. This includes progressing their profession to reveal all enchanted book trades. Having done this two times already in 2026, as well as having done the previous methods with Testificates when introduced in 2011 (The initial method took a 24 hours a day, for 7 days to 'breed' enough villagers who chose 'Librarian' as their occupation, AND offered the enchantment desired. 600+ villager deaths was the average during that time.), I will attest...it's not fun. Now you know, in part, the motivation of this datapack!

###########################################################################################################################################

    ########################################
    ### Organized Master Villager Trades ###
    ########################################
After the Villager reaches Master level in their profession, this system simply changes the order of avilable trades to not be random. Instead they're listed in a predetermined system with, generally, trades for Emeralds 1st, Equipment 2nd, Items 3rd, and Blocks 4th. 

    #############################
    # How this is accomplished: #
1: An advancement 'organize_master_advancement' detects when a player, right clicks on a Master level villager (or the normal Wandering Trader).

2. Reward function 'organize_master_reward_organizer_raycast_setup' then does a bunch of work: Remove the triggering advancement > Tags the Player who triggered the advancement as 'ORGANIZER' > Sets the 'steps' for the ray cast to 33 (3.3 blocks is the interaction distance) > runs the actual raycast operation function 'organizer_raycast_operation' which identifies if the player is looking at villager, and if so runs 'organizer_raycast_success' which tags the targeted villager with 'DISORGANIZED_MASTER'.

3. After the ray cast has tagged the villager in question, function 'profession_select' is ran. This checks the profession of the tagged villager, and if they weren't already tagged as `MASTER_<Profession>`, then the relevant `<Profession>_MASTER_ORGANIZE` function is ran.

4. `<Profession>_MASTER_ORGANIZE` then, removes and re-adds all* trades from the selected villager. Tag 'MASTER_<Profession>' is added to the Villager. Then 'schedule_celebration' is ran to create a few sounds and series of 'particle' effects to highlt the success of organization. Lastly, it schedules the function `remove_celebrate_tag`.

5. 'organized_<color>_effect_particle' creates 6 'entity_effects' of the stated colour around the selected master level Villager.

6. 'remove_celebrate_tag' removes the tag 'CELEBRATE_BEING_ORGANIZED' from the selected Villager *after* the particles are done being summoned.

5. Back to 'organize_master_reward_organizer_raycast_setup`, tag `ORGANIZER` is removed from the user, and 'DISORGANIZED_MASTER' is removed from the Villager.

!⯀!NOTE: all* = The 'explorer' and 'village' maps aren't removed or re-added to the Cartographer because, as of version 26.1 these maps can't be recreated in a datapack.!⯀!

###########################################################################################################################################

    #######################################
    ### SUSPICIOUS STEWS MADE MEMORABLE ###
    #######################################

This system is just a change to the loot tables and recipe results for Suspicious Stews to last strategically longer. These changes match the Farmer villager trades for the same. Full details on the file names, and locations is detailed in 'Suspicious Stew Change Log'.

###########################################################################################################################################

*Phew!*

####################
Thank you again to all who made this 2011 dream a reality. With this complete system, the tedious grind is no more. Now, there's an exciting incentive to go fishing, use an enchanting table, and explore the world - excited for the contents of every treasure chest! (Jungle Pyramids, Strongholds, Dungeons, Mineshafts, Ancient Cities, Desert Pyramids, Pillager Outposts, Ocean Ruins, Trial Chambers, Bastion Remnants, and Woodland Mansions!) And no more need to infinitely expand the world file size seeking out the 20th Trial Chamber or Ancient City so everyone can get 'Wind Charge III' and 'Swift Sneak III'!

#######################################################################################################################
